package Test;


import com.sun.xml.internal.messaging.saaj.util.FinalArrayList;
import com.sun.xml.internal.ws.api.message.HeaderList;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

public class Test12 {
    //三种获取反射的方式
    public static void main(String[] args) throws ClassNotFoundException {
        Class f1 = Class.forName("Test.Test12");
        Class f2 = String.class;
        String s = new String("123");
        Class f3 = s.getClass();
    }
    public static void main5(String[] args) {
        Integer a = 128;
        Integer b = 128;
        //Integer的缓存机制,范围为-128-127
        //超过该范围就会创建新的对象
        System.out.println(a == b);//false
    }
    public static void main4(String[] args) {
        String s = "123";
        int a = Integer.valueOf(s);
        System.out.println(a);
        int b = Integer.parseInt(s);
        System.out.println(b);
    }
    public static void main3(String[] args) {
        String str = new String("123");
//        String str = "123";
//        str.intern();
        String str2 = "123";
        System.out.println(str == str2);
    }
    public static void main2(String[] args) {
        List list = new ArrayList();
//        list1.add(1);
//        list1.add(2);
//        list1.add(3);
//        System.out.println(list1.toString());
    }
    public static void main1(String[] args) {
        ExecutorService pool = Executors.newFixedThreadPool(10);
        pool.submit(new Runnable() {
            @Override
            public void run() {
                while (true) {
                    System.out.println("我是r线程");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        });
    }

}
